package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WorkOrderInfoMapper;
import com.ruoyi.system.domain.WorkOrderInfo;
import com.ruoyi.system.service.IWorkOrderInfoService;

/**
 * 工作单信息Service业务层处理
 * 
 * @author LK
 * @date 2024-06-22
 */
@Service
public class WorkOrderInfoServiceImpl implements IWorkOrderInfoService 
{
    @Autowired
    private WorkOrderInfoMapper workOrderInfoMapper;

    /**
     * 查询工作单信息
     * 
     * @param workOrderId 工作单信息主键
     * @return 工作单信息
     */
    @Override
    public WorkOrderInfo selectWorkOrderInfoByWorkOrderId(String workOrderId)
    {
        return workOrderInfoMapper.selectWorkOrderInfoByWorkOrderId(workOrderId);
    }

    /**
     * 查询工作单信息列表
     * 
     * @param workOrderInfo 工作单信息
     * @return 工作单信息
     */
    @Override
    public List<WorkOrderInfo> selectWorkOrderInfoList(WorkOrderInfo workOrderInfo)
    {
        return workOrderInfoMapper.selectWorkOrderInfoList(workOrderInfo);
    }

    /**
     * 新增工作单信息
     * 
     * @param workOrderInfo 工作单信息
     * @return 结果
     */
    @Override
    public int insertWorkOrderInfo(WorkOrderInfo workOrderInfo)
    {
        UUID uuid = UUID.randomUUID();
        workOrderInfo.setWorkOrderId(String.valueOf(uuid));

        return workOrderInfoMapper.insertWorkOrderInfo(workOrderInfo);
    }

    /**
     * 修改工作单信息
     * 
     * @param workOrderInfo 工作单信息
     * @return 结果
     */
    @Override
    public int updateWorkOrderInfo(WorkOrderInfo workOrderInfo)
    {
        return workOrderInfoMapper.updateWorkOrderInfo(workOrderInfo);
    }

    /**
     * 批量删除工作单信息
     * 
     * @param workOrderIds 需要删除的工作单信息主键
     * @return 结果
     */
    @Override
    public int deleteWorkOrderInfoByWorkOrderIds(String[] workOrderIds)
    {
        return workOrderInfoMapper.deleteWorkOrderInfoByWorkOrderIds(workOrderIds);
    }

    /**
     * 删除工作单信息信息
     * 
     * @param workOrderId 工作单信息主键
     * @return 结果
     */
    @Override
    public int deleteWorkOrderInfoByWorkOrderId(String workOrderId)
    {
        return workOrderInfoMapper.deleteWorkOrderInfoByWorkOrderId(workOrderId);
    }
}
